bisect: advertise gzip,deflate encoding when supported#5434
Open
staabm wants to merge 9 commits intophpstan:2.1.xfrom
Open
bisect: advertise gzip,deflate encoding when supported#5434staabm wants to merge 9 commits intophpstan:2.1.xfrom
staabm wants to merge 9 commits intophpstan:2.1.xfrom
Conversation
staabm
commented
Apr 9, 2026
There was a problem hiding this comment.
Pull request overview
This PR improves download performance for bisect (and other HTTP fetches that reuse the same client setup) by advertising gzip,deflate support to allow servers to return compressed responses when PHP can decode them.
Changes:
- Added
PHPStan\Internal\HttpClientFactoryto create a Guzzle client and defaultAccept-Encoding: gzip,deflatewhenzlibis available. - Updated
BisectCommandto create its HTTP client via the new factory. - Updated
FixerApplicationto create its HTTP client via the new factory (and removed the directClientimport).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/Internal/HttpClientFactory.php |
New factory that sets default Accept-Encoding and instantiates GuzzleHttp\Client. |
src/Command/FixerApplication.php |
Switches to using HttpClientFactory for download checks and removes direct client construction. |
src/Command/BisectCommand.php |
Switches to using HttpClientFactory for GitHub API requests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
VincentLanglet
approved these changes
Apr 9, 2026
ondrejmirtes
requested changes
Apr 9, 2026
src/Internal/HttpClientFactory.php
Outdated
| * | ||
| * @see \GuzzleHttp\RequestOptions | ||
| */ | ||
| public static function createClient(array $config): Client |
Member
There was a problem hiding this comment.
Should be a service, not a static function. So we can pass options from config parameters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
time to fetch the commits..
... before this PR
... after this PR
-> saves ~10 seconds when downloading big responses